<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>用户管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/pageCommon.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/PageUtils.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/DemoData.js" charset="utf-8"></script>
	<script language="javascript" src="${pageContext.request.contextPath}/script/DataShowManager.js" charset="utf-8"></script>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/pageCommon.css" />
    <script type="text/javascript">
    </script>
</head>
<body>

<div id="Title_bar">
    <div id="Title_bar_Head"> 
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 用户管理
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<div id="MainArea">
    <table cellspacing="0" cellpadding="0" class="TableStyle">
       
        <!-- 表头-->
        <thead>
            <tr align=center valign=middle id=TableTitle>
                <td width="100">账户Id</td>
                <td width="100">用户姓名</td>
                <td width="100">部门编号</td>
                <td width="100">创建时间</td>
                <td width="100">是否激活</td>
                <td>相关操作</td>
            </tr>
        </thead>
        
        <!--显示数据列表-->
        <tbody id="TableData">
        	<c:if test="${statulist!=null && statulist.size()>0 }">
        		<c:forEach items="${statulist }" var="s">
        			<tr class="TableDetail1 template">
		                <td>${s.id }</td>
		    			<td>${s.customer.customer_name }</td>
		    			<td>${s.customer.customer_dept }</td>
		    			<td>${s.created_date }</td>
		    			
		                <td>
		                	<c:choose>
		                		<c:when test="${s.is_active==1 }">激活</c:when>
		                		<c:otherwise>禁用</c:otherwise>
		                	</c:choose>
		                </td>
		                <td>
		                	<!-- 
		                		如果当前记录是激活状态的，那么超链接就显示为禁用
		                	    如果当前记录是禁用状态的，那么超链接就显示为激活
		                	 -->
		                	<a href="${pageContext.request.contextPath}/CustomerServlet?opr=updateIsActive&userId=${u1.id}&isAcitve=${u1.isActive==1?0:1 }">${u1.isActive==1?"禁用":"激活" }</a>
		                    <a href="${pageContext.request.contextPath}/CustomerServlet?opr=loadData&CustomerId=${s.id}">修改</a>
							<a href="#" onClick="return window.confirm('您确定要初始化密码为1234吗？')">初始化密码</a>
		                </td>
		            </tr>
        		</c:forEach>
        	</c:if>
        </tbody>
    </table>
    
    <!-- 其他功能超链接 -->
    <div id="TableTail">
        <div id="TableTail_inside">
            <a href="${pageContext.request.contextPath}/CustomerServlet?opr=add"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a>
        </div>
    </div>
</div>

</body>
</html>

